import json

import numpy as np

a = '3'
b = int(a) if a else 0
print(int(b))

path = "./dataset/KUAKE-QQR_train.json"
data_list = []
with open(path, 'r', encoding='UTF-8') as input_data:
    json_content = json.load(input_data)
    # 逐条读取记录
    count = 0
    for block in json_content:
        # print(block)
        count += 1
        text_a = block['query1']
        text_b = block['query2']
        label = block['label']
        if label not in ['0', '1', '2']:
            label = 0
        data_list.append([text_a, text_b, int(label)])
    print(count)

print(type(data_list))
print(len(data_list))
print(np.array(data_list).shape)
